package ldh.im.base.message;

import java.time.LocalDateTime;

public abstract class Message<T> {

    private Long localId;                            // 本地消息ID
    private String serverId;                         // 服务端消息ID
    private Long fromUserId;                         // 发送方用户ID
    private T content;                               // 消息内容
    private LocalDateTime createDateTime;            // 消息产生时间
    private LocalDateTime sendDateTime;              // 消息发送时间
    private LocalDateTime sendSuccessDateTime;       // 消息发送到服务器时间
    private MessageStatus messageStatus;

    public Message() {
        createDateTime = LocalDateTime.now();
        messageStatus = MessageStatus.created;
    }

    public Long getLocalId() {
        return localId;
    }

    public void setLocalId(Long localId) {
        this.localId = localId;
    }

    public String getServerId() {
        return serverId;
    }

    public void setServerId(String serverId) {
        this.serverId = serverId;
    }

    public Long getFromUserId() {
        return fromUserId;
    }

    public void setFromUserId(Long fromUserId) {
        this.fromUserId = fromUserId;
    }

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }

    public MessageStatus getMessageStatus() {
        return messageStatus;
    }

    public void setMessageStatus(MessageStatus messageStatus) {
        this.messageStatus = messageStatus;
    }

    public LocalDateTime getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(LocalDateTime createDateTime) {
        this.createDateTime = createDateTime;
    }

    public LocalDateTime getSendDateTime() {
        return sendDateTime;
    }

    public void setSendDateTime(LocalDateTime sendDateTime) {
        this.sendDateTime = sendDateTime;
    }

    public LocalDateTime getSendSuccessDateTime() {
        return sendSuccessDateTime;
    }

    public void setSendSuccessDateTime(LocalDateTime sendSuccessDateTime) {
        this.sendSuccessDateTime = sendSuccessDateTime;
    }


}
